#if DEBUG
#else
[assembly: Microsoft.AspNetCore.Mvc.ApiController]
#endif

using Newtonsoft.Json.Serialization;

using RESTfulDemo.Services;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddSwaggerGen();

builder.Services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
builder.Services.AddSqlSugarSingleton(SqlSugar.DbType.MySql, "mysql");
builder.Services.AddControllers().AddNewtonsoftJson();
    //.AddNewtonsoftJson(setupAction =>
    //{
    //    setupAction.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
    //});

builder.Services.AddTransient<IService, StudentInfoService>();

var app = builder.Build();

app.UseSwagger();
app.UseSwaggerUI();

app.MapGet("/", () => "Hello,World");

app.MapControllers();

app.Run();